home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 71 / MOBICLIC 71.ISO / mac / DATA / COMMUN / temp0001 / 00265_Script_SCRIPTS_GENE_JLM_02 < prev    next >
Text File  |  2004-12-05  |  15KB  |  390 lines

  1. on getURL me,MODE,STUFF1--message envoyΘ par un swf α Director--------------
  2.   global g_ZFlashsound
  3.   case(MODE) of
  4.     1:--lancement d'un son externe dans un swf importΘ
  5.       g_ZFlashsound = 1
  6.       temp = value(STUFF1)
  7.       if voidP(temp) then
  8.         joueson(string(STUFF1))
  9.       else
  10.         sonRub(gimme2digits(temp))
  11.       end if
  12.     3:--lancement d'un bruitage externe dans un swf importΘ (ne baisse pas le son des autres pistes
  13.       g_ZFlashsound = 1
  14.       lowjoueson(string(STUFF1),2)
  15.     2:--pas de son
  16.       g_ZFlashsound = 0
  17.     otherwise
  18.       --
  19.   end case
  20. end
  21. ---------------------
  22. on TITRE TRUC
  23.   global gZ_pisteTitre, gL_sRubTitres
  24.   case(sprite(gZ_pisteTitre).member.type) of
  25.     #bitmap:-- titrage rasterisΘ
  26.       if TRUC = 0 then
  27.         sprite(gZ_pisteTitre).member = "TITRE_NOP"
  28.         sprite(gZ_pisteTitre).blend = 0
  29.       else
  30.         if value(TRUC) = TRUC then
  31.           sprite(gZ_pisteTitre).member = "TITRE_"&gimme2digits(TRUC)
  32.         else
  33.           sprite(gZ_pisteTitre).member = "TITRE_"&TRUC
  34.         end if
  35.         sprite(gZ_pisteTitre).blend = 100
  36.       end if
  37.     #text:--titre par conteneur texte
  38.       if TRUC = 0 then
  39.         sprite(gZ_pisteTitre).member.text = EMPTY
  40.       else
  41.         --        sprite(gZ_pisteTitre).member.text = gL_sRubTitres[TRUC]
  42.         sprite(gZ_pisteTitre).member.text = TRUC
  43.       end if
  44.   end case
  45.   updateStage
  46. end
  47. ----------------------
  48. on TFC()
  49.   load_localTextes()
  50. end
  51. --------------------
  52. on load_localTextes
  53.   global L_TANKER
  54.   --  if the runMode = "author" and lien() = ":" then
  55.   if the runMode = "author" then
  56.     fin = the number of members of castLib(1)
  57.     flag = 0
  58.     test = COMMENT_TANK()
  59.     repeat with i = 1 to fin
  60.       if member(i).name = test then
  61.         flag = 1
  62.         exit repeat
  63.       end if
  64.     end repeat
  65.     if flag = 0 then
  66.       newmember = new(#text)
  67.       member(newmember).name = test
  68.       member(newmember).font = "Comic Sans MS"
  69.     end if
  70.     if the paramCount = 0 then--importation directe
  71.       u = member("LOCAL_MATOS").castLibNum
  72.       v = member("LOCAL_MATOS").memberNum
  73.       importFileInto member("LOCAL_MATOS"), "@//COMMUN/DATABASE/"&zracine()&".rtf"
  74.       member(v,u).name = "LOCAL_MATOS"
  75.     else
  76.       --copier coller
  77.     end if
  78.     temp = member("LOCAL_MATOS").text
  79.     TANKER = EMPTY
  80.     L_TANKER = [#_TITRE:0]
  81.     -------------------------------------------------------------on charge le titre zapette
  82.     M =  offset("@titre",temp)
  83.     N =  offset("@aide",temp)
  84.     tampon = temp.char[M..N-1]
  85.     --  on retire la premiΦre ligne (qui contient"@titre")
  86.     fin = tampon.line.count
  87.     tampon = tampon.line[2..fin]
  88.     -- on retire les lignes blanches, les sauts de lignes et espaces finals
  89.     TANKER = TANKER&cleanTail(tampon)&RETURN
  90.     repere1 = 1
  91.     repere2 = TANKER.char.count
  92.     L_TANKER._TITRE = [repere1,repere2]
  93.     -------------------------------------------------------------on charge l'aide
  94.     M =  N
  95.     N =  offset("@info",temp)
  96.     tampon = temp.char[M..N-1]
  97.     --  on retire la premiΦre ligne (qui contient"@aide")
  98.     fin = tampon.line.count
  99.     tampon = tampon.line[2..fin]
  100.     -- on retire les lignes blanches, les sauts de lignes et espaces finals
  101.     TANKER = TANKER&cleanTail(tampon)&RETURN
  102.     repere1 = repere2 + 1
  103.     repere2 = TANKER.char.count
  104.     L_TANKER.addProp(#_AIDE,[repere1,repere2])
  105.     ------------------------------------------------------------on charge l'info
  106.     M =  N
  107.     N =  offset("@dico",temp)
  108.     tampon = temp.char[M..N-1]
  109.     --  on retire la premiΦre ligne (qui contient"@aide")
  110.     fin = tampon.line.count
  111.     tampon = tampon.line[2..fin]
  112.     -- on retire les lignes blanches, les sauts de lignes et espaces finals
  113.     TANKER = TANKER&cleanTail(tampon)&RETURN
  114.     repere1 = repere2 + 1
  115.     repere2 = TANKER.char.count
  116.     L_TANKER.addProp(#_INFO,[repere1,repere2])
  117.     ------------------------------------------------------------on charge le dico
  118.     M =  N
  119.     N =  offset("@@",temp)
  120.     tampon = temp.char[M..N-1]
  121.     --  on retire la premiΦre ligne (qui contient"@aide")
  122.     fin = tampon.line.count
  123.     tampon = tampon.line[2..fin]
  124.     -- on retire les lignes blanches, les sauts de lignes et espaces finals
  125.     TANKER = TANKER&cleanTail(tampon)&RETURN
  126.     repere1 = repere2 + 1
  127.     repere2 = TANKER.char.count
  128.     L_TANKER.addProp(#_DICO,[repere1,repere2])
  129.     ------------------------------------------------------------on charge les commentaires
  130.     --on dΘlimite la fourchette de charactΦres α prendre
  131.     M = offset("@@",temp)
  132.     N = offset("@EOF",temp)
  133.     tampon = temp.char[M+2..N] 
  134.     M = offset("@",tampon)--on recherche la position du premier commentaire
  135.     N = tampon.char.count
  136.     BRUT = tampon.char[M+1..N]--on part du 2Φme caractΦre (on supprime "@")
  137.     repere1 = repere2 + 1--initialisation du compteur de repΦre de dΘbut de comment dans TANKER
  138.     repeat while N > 0 and BRUT <> EMPTY
  139.       M = 1
  140.       N = offset("@",BRUT)
  141.       tampon = cleanTail(BRUT.char[M..N])-- on stocke le bloc commentaire repΘrΘ,on va le nettoyer
  142.       Nblignes = tampon.line.count
  143.       nomSon = cleanTail(tampon.line[1])--on nettoie la fin de la premiΦre ligne pour obtenir le nom du fichier son
  144.       texte = cleantail(tampon.line[2..Nblignes-1])-- on extrait le texte en retirant la ligne 1 (nom du son), la derniΦre (contient @) et en nattoyant
  145.       --les lignes blanches
  146.       if zRacine() = "QUIZ00" then texte = texte.line[1]--dans le  cas du quizz on supprime les propositions
  147.       TANKER = TANKER&texte&RETURN
  148.       repere2 = TANKER.char.count -1
  149.       L =[repere1,repere2]-----on pile le nom du son, le repΦre de dΘbut de comment, celui de fin
  150.       repere1 = repere2 + 2
  151.       Lrestant = BRUT.char.count
  152.       BRUT = BRUT.char[N + 1..Lrestant]-- on retire la partie traitΘe (y compris le @ de dΘbut de ligne)
  153.       L_TANKER.addProp(CLEANLOWCASE(nomSon),L)
  154.     end repeat
  155.     member(COMMENT_TANK()).text = cleanTail(TANKER)&RETURN&string(L_TANKER)
  156.     member(COMMENT_TANK()).font = "Comic Sans MS"
  157.     -------------------------------------------------------------dans le cas de QUIZCITY on charge les questions
  158.     if zRacine() = "QUIZ00" then load_QUIZmatos()
  159.   end if
  160. end
  161. ---------------------------------- 
  162. on load_QUIZmatos
  163.   global gNbQ_TED, gNbQ_ButTED
  164.   if voidP(gNbQ_TED) then gNbQ_TED = localdata(2)
  165.   if voidP(gNbQ_ButTED) then  gNbQ_ButTED = localdata(4)
  166.   LQ = []
  167.   --  temp = member("MATOS_BRUT").text
  168.   temp = member("LOCAL_MATOS").text
  169.   --on dΘlimite la fourchette de caractΦres α prendre
  170.   repeat with i = 1 to gNbQ_TED--on charge les infos concernant le quiz tout est dit---------------------
  171.     L_localQ = []
  172.     M =  offset("@quiz"&gimme2digits(i),temp)
  173.     if i < gNbQ_TED then 
  174.       N = offset("@quiz"&gimme2digits(i+1),temp)
  175.     else
  176.       N = offset("@quiz"&gimme2digits(40),temp)
  177.     end if
  178.     tampon = temp.char[M..N-1]
  179.     fin = tampon.line.count
  180.     --on retire la premiΦre ligne (qui contient"@quizXX.aif")
  181.     tampon = tampon.line[2..fin]
  182.     -- on retire les lignes blanches α la fin
  183.     u = fin
  184.     repeat while tampon.line[u] = EMPTY
  185.       u = u-1
  186.       tampon = tampon.line[1..u]
  187.     end repeat
  188.     -- on retire le saut de ligne
  189.     fin = tampon.char.count
  190.     if tampon.char[fin] = RETURN then tampon = tampon.char[1..fin-1]
  191.     --on enregistre la question
  192.     L_localQ.add(tampon.line[1])
  193.     --on retire la ligne de la question
  194.     fin = tampon.line.count
  195.     tampon = tampon.line[2..fin]
  196.     -- on retire les lignes blanches entre la question et les rΘponses
  197.     u = tampon.line.count
  198.     repeat while tampon.line[1] = EMPTY
  199.       tampon = tampon.line[2..U]
  200.       u = u-1
  201.     end repeat
  202.     repeat with j = 1 to 3
  203.       v = tampon.line[j]
  204.       if v contains "jpg" or v contains "pct" then--rΘponse associΘe α une image
  205.         if v contains "(OK)" then NoGood = j
  206.         if v contains "jpg" then
  207.           suffixe =".jpg"
  208.         else
  209.           if v contains "pct" then
  210.             suffixe =".pct"
  211.           end if
  212.         end if
  213.         L_localQ.add(["I", "PH"&gimme2digits(i)&"_"&j&suffixe])
  214.       else
  215.         if v contains "mov" then--rΘponse associΘe α une vidΘo
  216.           if v contains "(OK)" then NoGood = j
  217.           L_localQ.add(["V", "V_"&gimme2digits(i)&"_"&j&".mov"])
  218.         else
  219.           if v contains "BOUCLE_" then--rΘponse associΘe α une boucle animΘe
  220.             L_localQ.add(["B", "V"&gimme2digits(i)&"_"&j])
  221.           else
  222.             if v contains "aif" or v contains "mp3" then--rΘponse associΘe α un son
  223.               if v contains "(OK)" then NoGood = j
  224.               if v contains "aif" then
  225.                 suffixe =".aif"
  226.               else
  227.                 if v contains "mp3" then
  228.                   suffixe =".mp3"
  229.                 end if
  230.               end if
  231.               L_localQ.add(["S", "S"&gimme2digits(i)&"_"&j&suffixe])
  232.             else--rΘponse associΘe α un texte
  233.               if v contains "(OK)" then
  234.                 NoGood = j
  235.                 EOL = offset("(OK)",v)-1
  236.                 v= cleanTail(v.char[1..EOL-1])
  237.               end if
  238.               L_localQ.add(["T", cleanTail(v)])
  239.             end if
  240.           end if
  241.         end if
  242.       end if
  243.     end repeat
  244.     L_localQ.add(NoGood)
  245.     LQ.add(L_localQ)
  246.   end repeat
  247.   ------------------------------------
  248.   repeat with i = 40 to 39 + gNbQ_ButTED--on charge les infos concernant le reste du quiz
  249.     L_localQ = []
  250.     M =  offset("@quiz"&gimme2digits(i),temp)
  251.     if i < 39 + gNbQ_ButTED then 
  252.       N = offset("@quiz"&gimme2digits(i+1),temp)
  253.     else
  254.       N = offset("@EOF",temp)
  255.     end if
  256.     tampon = temp.char[M..N-1]
  257.     fin = tampon.line.count
  258.     --on retire la premiΦre ligne (qui contient"@quizXX.aif")
  259.     tampon = tampon.line[2..fin]
  260.     -- on retire les lignes blanches α la fin
  261.     u = fin
  262.     repeat while tampon.line[u] = EMPTY
  263.       u = u-1
  264.       tampon = tampon.line[1..u]
  265.     end repeat
  266.     -- on retire le saut de ligne
  267.     fin = tampon.char.count
  268.     if tampon.char[fin] = RETURN then tampon = tampon.char[1..fin-1]
  269.     --on enregistre la question
  270.     L_localQ.add(tampon.line[1])
  271.     --on retire la ligne de la question
  272.     fin = tampon.line.count
  273.     tampon = tampon.line[2..fin]
  274.     -- on retire les lignes blanches entre la question et les rΘponses
  275.     u = tampon.line.count
  276.     repeat while tampon.line[1] = EMPTY
  277.       tampon = tampon.line[2..U]
  278.       u = u-1
  279.     end repeat
  280.     repeat with j = 1 to 3
  281.       v = tampon.line[j]
  282.       if v contains "jpg" or v contains "pct" then--rΘponse associΘe α une image
  283.         if v contains "(OK)" then NoGood = j
  284.         if v contains "jpg" then
  285.           suffixe =".jpg"
  286.         else
  287.           if v contains "pct" then
  288.             suffixe =".pct"
  289.           end if
  290.         end if
  291.         L_localQ.add(["I", "PH"&gimme2digits(i)&"_"&j&suffixe])
  292.       else
  293.         if v contains "mov" then--rΘponse associΘe α une vidΘo
  294.           if v contains "(OK)" then NoGood = j
  295.           L_localQ.add(["V", "V"&gimme2digits(i)&"_"&j&"mov"])
  296.         else
  297.           if v contains "BOUCLE_" then--rΘponse associΘe α une boucle animΘe
  298.             L_localQ.add(["B", "V_"&gimme2digits(i)&"_"&j])
  299.           else
  300.             if v contains "aif" or v contains "mp3" then--rΘponse associΘe α un son
  301.               if v contains "(OK)" then NoGood = j
  302.               if v contains "aif" then
  303.                 suffixe =".aif"
  304.               else
  305.                 if v contains "mp3" then
  306.                   suffixe =".mp3"
  307.                 end if
  308.               end if
  309.               L_localQ.add(["S", "S"&gimme2digits(i)&"_"&j&suffixe])
  310.             else--rΘponse associΘe α un texte
  311.               if v contains "(OK)" then
  312.                 NoGood = j
  313.                 EOL = offset("(OK)",v)-1
  314.                 v= cleanTail(v.char[1..EOL-1])
  315.               end if
  316.               L_localQ.add(["T", cleanTail(v)])
  317.             end if
  318.           end if
  319.         end if
  320.       end if
  321.     end repeat
  322.     L_localQ.add(NoGood)
  323.     LQ.add(L_localQ)
  324.   end repeat
  325.   fin = count(LQ)
  326.   tampon = member("localdata").line[1..7]
  327.   member("localdata").text = EMPTY
  328.   member("localdata").text = tampon
  329.   repeat with i = 1 to fin
  330.     member("localdata").line[i + 7] = LQ[i]
  331.   end repeat
  332. end
  333. ----------------
  334. on printJLM
  335.   case(the paramCount) of
  336.     0:--impression d'Θcran
  337.       imprime()
  338.     1:--impression d'acteur sans prΘcision de distrib
  339.       NoDistrib = 1
  340.       imprimeActeur(member(param(1)).memberNum,NoDistrib)
  341.     2:--impression d'acteur dΘfini par n0 de distrib et nom
  342.       imprimeActeur(member(param(1)).memberNum,member(param(1)).castLibNum)
  343.   end case
  344. end
  345. ---------------------------
  346. on zScore NoPHASE,MODE, COIN_HG_FEN
  347.   global gScore_Fen,gScore_NomFic,gModeScore
  348.   gModeScore = MODE
  349.   case(NoPHASE) of
  350.     1:--ouverture de la fenΩtre de score
  351.       gScore_NomFic = "M"&gimme2digits(zNoMobi())&zRacine()
  352.       Nomdir = zRacine()&"_SCORE"
  353.       gScore_fen = window(Nomdir&"_TEMP")
  354.       x0 = the stageLeft
  355.       y0 = the stageTop
  356.       if D10() then window().new(Nomdir&"_TEMP")
  357.       Maskrect = [member(Nomdir&"_MASK").width,member(Nomdir&"_MASK").height]
  358.       x1= x0 + COIN_HG_FEN[1]
  359.       y1 = y0 + COIN_HG_FEN[2]
  360.       rect_Fen = rect(x1,y1, x1 + Maskrect[1] ,y1 + Maskrect[2])
  361.       gScore_fen .rect = rect_Fen
  362.       gScore_fen .filename = "@/"&Nomdir
  363.       case(lien()) of
  364.         ":":--------------------------------------- on est sur un Mac
  365.           case(zOs()[2]>=10) of
  366.             1:------------------------------------------- on est sous OsX
  367.               gScore_fen.appearanceOptions.mask = member(Nomdir&"_MASK")
  368.               gScore_fen.type = #tool
  369.               gScore_fen.appearanceOptions.shadow = FALSE
  370.             0:------------------------------------------- on est sous Classic
  371.               gScore_fen.appearanceOptions.mask = member(Nomdir&"_MASK")
  372.           end case
  373.         "\":--------------------------------------- on est sur un Pc
  374.           gScore_fen.type = #tool
  375.           gScore_fen.appearanceOptions.mask = member(Nomdir&"_MASK")
  376.       end case
  377.       gScore_fen.title =EMPTY
  378.       gScore_fen.open()
  379.     2:--rΘouverture pour consultation des rΘsultats
  380.       tell gScore_Fen
  381.         gScore_fen.open()
  382.         go "RESULTAT"
  383.       end tell
  384.   end case
  385. end
  386. ------------------------
  387.  
  388.  
  389.  
  390.